import http from "@/http";
import { createDirType, FileListParm, getByFileNameParm } from "./DocumentModel";

//新建文件夹
export const createDirApi = (parm: createDirType) => {
    return http.post("/api/office-file/createDir", parm)
}

//列表
export const getListApi = (parm: FileListParm) => {
    return http.get("/api/office-file/getList", parm)
}

//文件上传
export const uploadFileApi = (parm: FormData) => {
    return http.upload("/api/office-file/upload", parm)
}

//下载文件
export const downloadFileApi = (id: number) => {
    return http.download("/api/office-file/download/" + id)
}

//根据文件名查询
export const getByFileNameApi = (parm: getByFileNameParm) => {
    return http.get("/api/office-file/getConditionData", parm)
}

//根据id删除
export const deleteApi = (roleId: string) => {
    return http.delete(`/api/office-file/${roleId}`)
}
